package com.wxd.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.pojo.TClinicDepartment;
import com.guigu.pojo.TDiseaseLibrary;
import com.wxd.service.TDiseaseService;
import com.wxd.vo.PageVo;
import com.wxd.vo.TDiseaseLibraryTCD;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TDiseaseController {
    @Resource
    TDiseaseService tDiseaseService;

    @RequestMapping("TDiseaseSelect")
    public PageInfo<TDiseaseLibraryTCD> TDiseaseSelect(@RequestBody PageVo<TDiseaseLibraryTCD> pageVo){
        PageInfo<TDiseaseLibraryTCD> com=this.tDiseaseService.SelectTDiseaseLibrary(pageVo);
        return com;
    }

    @RequestMapping("deleteTDisease")
    public void deleteTDisease(@RequestBody TDiseaseLibrary tDiseaseLibrary ){
        this.tDiseaseService.DeleteByPrimaryKey(tDiseaseLibrary);
    }

    @RequestMapping("insertTDisease")
    public void insertTDisease(@RequestBody TDiseaseLibrary tDiseaseLibrary){
        this.tDiseaseService.Insert(tDiseaseLibrary);
    }

    @RequestMapping("updeteTDisease")
    public void updeteTDisease(@RequestBody TDiseaseLibrary tDiseaseLibrary){
        this.tDiseaseService.UpdateByPrimaryKey(tDiseaseLibrary);
        System.out.println(tDiseaseLibrary);
    }
    @RequestMapping("Query")
    public List<TClinicDepartment> QUERY(){
        return this.tDiseaseService.Query();
    }
}
